gsk: Fix angle normalization
authorAlexander Larsson <alexl@redhat.com>
Tue, 11 Feb 2020 09:00:34 +0000 (10:00 +0100)
committerAlexander Larsson <alexl@redhat.com>
Tue, 11 Feb 2020 12:51:06 +0000 (13:51 +0100)
commit1f0438e7fe7a6580116d95a922948ee63c7547b4
tree9b38f3291283225f02ca3b64cf764bc2daad4ba4
parentaf98c46d04d86e192349d20711d36dbb1de9bc9d
gsk: Fix angle normalization

I was getting assertions that normalize_angle() failed the
result < 260 check. Doing some research on this it turns out
to be a precision issue. If the incomming angle is very slightly
below zero, then adding 360 to it may end up with exactly 360.

I simplified the code a bit to avoid division and rounding, because in
practice most angles will be "just outside" the 0-360 degree anyway.
And i also added a workaround for the "result is 360" case by just
setting it to 0.
gsk/gsktransform.c